import { axios } from '@/utils/request'

const api = {
  //获取让利设置
  getProfitSetting:'/saas/get-profit-setting',
  // 店铺分销列表
  shopDistributionList: '/saas/store-share-list',
  // 修改店铺分销设置
  editShopSetting: '/saas/store-share-option',
  getShopSetting: '/saas/store-default-params',
  // 店铺分销佣金明细
  shopDistributionLog: 'saas/store-share-log',
  // 联盟分销列表
  allianceDistributionList: '/saas/saas-share-list',
  // 联盟分销佣金明细
  allianceDistributionLog: '/saas/saas-share-log',
  // 推荐人列表
  shopReferrerList: '/saas/referral-list',
  // 推荐人设置
  editShopReferrer:'/saas/edit-referral',
  saasReferralDefaultParams:'/saas/saas-referral-default-params',
  // 推荐人佣金明细
  shopReferrerLog:'/saas/referral-share-log',
  // 删除推荐人关系
  delReferrerLog:'/saas/delete-referral',
  // 消费返利列表
  consumerRebateList:'/saas/store-self-rebate-list',
  // 消费返利设置
  consumerRebateSttting:'/saas/store-self-rebate-option',
  selfRebateDefaultParams:'/saas/self-rebate-default-params',
  // 消费返利佣金明细
  consumerRebateLog:'/saas/store-self-rebate-log',
  // 店铺抽成
  storeTransferProfitParams:'/saas/store-transfer-profit-params'
}

export default api

export function shopDistributionList(parameter) {
  return axios({
    url: api.shopDistributionList,
    method: 'get',
    params: parameter
  })
}

export function editShopSetting(parameter) {
  return axios({
    url: api.editShopSetting,
    method: 'post',
    data: parameter
  })
}
export function getShopSetting() {
  return axios({
    url: api.getShopSetting,
    method: 'get'
  })
}

//getProfitSetting
export function getProfitSetting() {
  return axios({
    url: api.getProfitSetting,
    method: 'get'
  })
}

export function shopDistributionLog(parameter) {
  return axios({
    url: api.shopDistributionLog,
    method: 'get',
    params: parameter
  })
}

export function allianceDistributionList(parameter) {
  return axios({
    url: api.allianceDistributionList,
    method: 'get',
    params: parameter
  })
}

export function allianceDistributionLog(parameter) {
  return axios({
    url: api.allianceDistributionLog,
    method: 'get',
    params: parameter
  })
}

export function shopReferrerList(parameter) {
  return axios({
    url: api.shopReferrerList,
    method: 'get',
    params: parameter
  })
}

export function editShopReferrer(parameter) {
  return axios({
    url: api.editShopReferrer,
    method: 'post',
    data: parameter
  })
}

export function shopReferrerLog(parameter) {
  return axios({
    url: api.shopReferrerLog,
    method: 'get',
    params: parameter
  })
}

export function delReferrerLog(parameter) {
  return axios({
    url: api.delReferrerLog,
    method: 'post',
    data: parameter
  })
}

export function consumerRebateList(parameter) {
  return axios({
    url: api.consumerRebateList,
    method: 'get',
    params: parameter
  })
}

export function consumerRebateSttting(parameter) {
  return axios({
    url: api.consumerRebateSttting,
    method: 'post',
    data: parameter
  })
}

export function selfRebateDefaultParams() {
  return axios({
    url: api.selfRebateDefaultParams,
    method: 'get',
  })
}


export function consumerRebateLog(parameter) {
  return axios({
    url: api.consumerRebateLog,
    method: 'get',
    params: parameter
  })
}

export function saasReferralDefaultParams() {
  return axios({
    url: api.saasReferralDefaultParams,
    method: 'get',
  })
}

export function getStoreTransferProfitParams() {
  return axios({
    url: api.storeTransferProfitParams,
    method: 'get',
  })
}

export function setStoreTransferProfitParams(data) {
  return axios({
    url: api.storeTransferProfitParams,
    method: 'post',
    data
  })
}